#!/bin/bash

awk '{if(FNR%3==0){print $0 > "a7.txt"}}' a.txt
